﻿<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="PurchaseSales.Manage" namespace="PurchaseSales.Manage.Model.Entities">
  <class name="Users" table="Users" >
    <id name="Id" column="Id" type="Guid">
      <generator class="guid.comb" />
    </id>
    <property type="string" name="AgentId" column="[AgentId]" />
    <property type="string" name="Name" column="[Name]" />
    <property type="string" name="Password" column="[Password]" />

    <many-to-one class="AuthRoles" name="Role" column="RoleId"/>
    
    <bag name="SalesPersons" cascade="all" lazy="true">
      <key column="SaleUser"/>
      <one-to-many  class="Sales"/>
    </bag>
  </class>
</hibernate-mapping>